
Obj/FWlib_apt32f172_uart.o:     file format elf32-csky-little


Disassembly of section .text:

00000000 <UART_DeInit>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void UART_DeInit(void)
{
    UART1->DATA = UART_RESET_VALUE;
   0:	1065      	lrw      	r3, 0	// 14 <UART_DeInit+0x14>
   2:	3200      	movi      	r2, 0
   4:	9360      	ld.w      	r3, (r3, 0)
   6:	b340      	st.w      	r2, (r3, 0)
    UART1->SR   = UART_RESET_VALUE;
   8:	b341      	st.w      	r2, (r3, 0x4)
    UART1->CTRL = UART_RESET_VALUE;
   a:	b342      	st.w      	r2, (r3, 0x8)
    UART1->ISR  = UART_RESET_VALUE;
   c:	b343      	st.w      	r2, (r3, 0xc)
    UART1->BRDIV =UART_RESET_VALUE;
   e:	b344      	st.w      	r2, (r3, 0x10)
}
  10:	783c      	rts
  12:	0000      	bkpt
  14:	00000000 	.long	0x00000000

00000018 <UART1_Int_Enable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void UART1_Int_Enable(void)
{
    UART1->ISR=0x0F;									//clear UART1 INT status
  18:	1267      	lrw      	r3, 0	// 134 <UARTReceive+0x32>
  1a:	320f      	movi      	r2, 15
  1c:	9360      	ld.w      	r3, (r3, 0)
  1e:	b343      	st.w      	r2, (r3, 0xc)
	INTC_ISER_WRITE(UART1_INT);							//INT Vector Enable UART0/1 Interrupt in CK802
  20:	3280      	movi      	r2, 128
  22:	1266      	lrw      	r3, 0	// 138 <UARTReceive+0x36>
  24:	4247      	lsli      	r2, r2, 7
  26:	9360      	ld.w      	r3, (r3, 0)
  28:	23ff      	addi      	r3, 256
  2a:	b340      	st.w      	r2, (r3, 0)
}
  2c:	783c      	rts

0000002e <UART1_Int_Disable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void UART1_Int_Disable(void)
{
    INTC_ICER_WRITE(UART1_INT);							//INT Vector Enable UART0/1 Interrupt in CK802
  2e:	1263      	lrw      	r3, 0	// 138 <UARTReceive+0x36>
  30:	32c0      	movi      	r2, 192
  32:	9360      	ld.w      	r3, (r3, 0)
  34:	4241      	lsli      	r2, r2, 1
  36:	60c8      	addu      	r3, r2
  38:	3280      	movi      	r2, 128
  3a:	4247      	lsli      	r2, r2, 7
  3c:	b340      	st.w      	r2, (r3, 0)
}
  3e:	783c      	rts

00000040 <UART1_WakeUp_Enable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void UART1_WakeUp_Enable(void)
{
    INTC_IWER_WRITE(UART1_INT);    
  40:	117e      	lrw      	r3, 0	// 138 <UARTReceive+0x36>
  42:	3280      	movi      	r2, 128
  44:	9360      	ld.w      	r3, (r3, 0)
  46:	23ff      	addi      	r3, 256
  48:	4247      	lsli      	r2, r2, 7
  4a:	b350      	st.w      	r2, (r3, 0x40)
}
  4c:	783c      	rts

0000004e <UART1_WakeUp_Disable>:
//EntryParameter:NONE
//ReturnValue:NONE
/*************************************************************/
void UART1_WakeUp_Disable(void)
{
    INTC_IWDR_WRITE(UART1_INT);    
  4e:	117b      	lrw      	r3, 0	// 138 <UARTReceive+0x36>
  50:	32e0      	movi      	r2, 224
  52:	9360      	ld.w      	r3, (r3, 0)
  54:	4241      	lsli      	r2, r2, 1
  56:	60c8      	addu      	r3, r2
  58:	3280      	movi      	r2, 128
  5a:	4247      	lsli      	r2, r2, 7
  5c:	b340      	st.w      	r2, (r3, 0)
}
  5e:	783c      	rts

00000060 <UART_IO_Init>:
//UART_IO_G:0 1
//ReturnValue:NONE
/*************************************************************/
void UART_IO_Init(UART_NUM_TypeDef UART_IO_G)
{
    if (UART_IO_G==IO_PD0)
  60:	3840      	cmpnei      	r0, 0
  62:	080a      	bt      	0x76	// 76 <UART_IO_Init+0x16>
    {
		GPIOD0->CONLR = (GPIOD0->CONLR&0XFFFFFF00)  | 0x00000055;       //PD0.1->RXD0, PD0.0->TXD0
  64:	1176      	lrw      	r3, 0	// 13c <UARTReceive+0x3a>
  66:	31ff      	movi      	r1, 255
  68:	9340      	ld.w      	r2, (r3, 0)
  6a:	9260      	ld.w      	r3, (r2, 0)
  6c:	68c5      	andn      	r3, r1
  6e:	3155      	movi      	r1, 85
  70:	6cc4      	or      	r3, r1
  72:	b260      	st.w      	r3, (r2, 0)
    }
     if (UART_IO_G==IO_PA1)
    {
		GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000660;       //PA1.2->RXD1, PA1.1->TXD1
    }
}
  74:	783c      	rts
     if (UART_IO_G==IO_PA1)
  76:	3841      	cmpnei      	r0, 1
  78:	0bfe      	bt      	0x74	// 74 <UART_IO_Init+0x14>
		GPIOA1->CONLR = (GPIOA1->CONLR&0XFFFFF00F)  | 0x00000660;       //PA1.2->RXD1, PA1.1->TXD1
  7a:	1172      	lrw      	r3, 0	// 140 <UARTReceive+0x3e>
  7c:	32ff      	movi      	r2, 255
  7e:	9320      	ld.w      	r1, (r3, 0)
  80:	9160      	ld.w      	r3, (r1, 0)
  82:	4244      	lsli      	r2, r2, 4
  84:	68c9      	andn      	r3, r2
  86:	32cc      	movi      	r2, 204
  88:	4243      	lsli      	r2, r2, 3
  8a:	6cc8      	or      	r3, r2
  8c:	b160      	st.w      	r3, (r1, 0)
}
  8e:	07f3      	br      	0x74	// 74 <UART_IO_Init+0x14>

00000090 <UARTInit>:
//ReturnValue:NONE
/*************************************************************/
void UARTInit(CSP_UART_T *uart,U32_T baudrate_u16)
{
   // Set Transmitter Enable
   CSP_UART_SET_CTRL(uart, UART_TX | UART_RX);
  90:	3303      	movi      	r3, 3
  92:	b062      	st.w      	r3, (r0, 0x8)
   // Set Baudrate
   CSP_UART_SET_BRDIV(uart, baudrate_u16);
  94:	b024      	st.w      	r1, (r0, 0x10)

}
  96:	783c      	rts

00000098 <UARTInitRxTxIntEn>:
  98:	330b      	movi      	r3, 11
  9a:	b062      	st.w      	r3, (r0, 0x8)
  9c:	b024      	st.w      	r1, (r0, 0x10)
  9e:	9062      	ld.w      	r3, (r0, 0x8)
  a0:	6c8c      	or      	r2, r3
  a2:	b042      	st.w      	r2, (r0, 0x8)
  a4:	783c      	rts

000000a6 <UARTInitRxIntEn>:
//ReturnValue:NONE
/*************************************************************/
void UARTInitRxIntEn(CSP_UART_T *uart,U32_T baudrate_u16,UART_PAR_TypeDef PAR_DAT)
{
   // Set Transmitter Enable
   CSP_UART_SET_CTRL(uart, UART_TX | UART_RX | UART_RX_INT);
  a6:	330b      	movi      	r3, 11
  a8:	b062      	st.w      	r3, (r0, 0x8)
   // Set Baudrate
   CSP_UART_SET_BRDIV(uart, baudrate_u16);
  aa:	b024      	st.w      	r1, (r0, 0x10)
   
   uart->CTRL|=PAR_DAT;
  ac:	9062      	ld.w      	r3, (r0, 0x8)
  ae:	6c8c      	or      	r2, r3
  b0:	b042      	st.w      	r2, (r0, 0x8)
}
  b2:	783c      	rts

000000b4 <UARTClose>:
//ReturnValue:NONE
/*************************************************************/
void UARTClose(CSP_UART_T *uart)
{
	// Set Transmitter Disable
	CSP_UART_SET_CTRL(uart, 0x00);
  b4:	3300      	movi      	r3, 0
  b6:	b062      	st.w      	r3, (r0, 0x8)
}
  b8:	783c      	rts

000000ba <UARTTxByte>:
/*************************************************************/
void UARTTxByte(CSP_UART_T *uart,U8_T txdata_u8)
{
	unsigned int  DataI;
	// Write the transmit buffer
	CSP_UART_SET_DATA(uart,txdata_u8);
  ba:	b020      	st.w      	r1, (r0, 0)
	do
	{
		DataI = CSP_UART_GET_SR(uart);
		DataI = DataI & UART_TX_FULL;
  bc:	3201      	movi      	r2, 1
		DataI = CSP_UART_GET_SR(uart);
  be:	9061      	ld.w      	r3, (r0, 0x4)
		DataI = DataI & UART_TX_FULL;
  c0:	68c8      	and      	r3, r2
	}
	while(DataI == UART_TX_FULL);    //Loop  when tx is full
  c2:	3b40      	cmpnei      	r3, 0
  c4:	0bfd      	bt      	0xbe	// be <UARTTxByte+0x4>
	// Wait for the transmit done
	while ( (CSP_UART_GET_ISR(uart) & UART_TX_INT_S) != UART_TX_INT_S ) {}

	// Clear status bit for the next transmit
	CSP_UART_SET_ISR(uart, UART_TX_INT_S);*/
}
  c6:	783c      	rts

000000c8 <UARTTransmit>:
//UART Transmit 
//EntryParameter:UART1,sourceAddress_u16,length_u16
//ReturnValue:NONE
/*************************************************************/
void UARTTransmit(CSP_UART_T *uart,U8_T *sourceAddress_u16,U16_T length_u16)
{
  c8:	14c2      	push      	r4-r5
	unsigned int  DataI,DataJ;
	for(DataJ = 0;DataJ < length_u16 ;DataJ ++)
  ca:	6cc7      	mov      	r3, r1
	{
		CSP_UART_SET_DATA(uart,*sourceAddress_u16++);
		do{
			DataI = CSP_UART_GET_SR(uart);
			DataI = DataI & UART_TX_FULL;
  cc:	3501      	movi      	r5, 1
	for(DataJ = 0;DataJ < length_u16 ;DataJ ++)
  ce:	5b85      	subu      	r4, r3, r1
  d0:	6490      	cmphs      	r4, r2
  d2:	0c02      	bf      	0xd6	// d6 <UARTTransmit+0xe>
		}while(DataI == UART_TX_FULL);    //Loop  when tx is full
	}
}
  d4:	1482      	pop      	r4-r5
		CSP_UART_SET_DATA(uart,*sourceAddress_u16++);
  d6:	8380      	ld.b      	r4, (r3, 0)
  d8:	b080      	st.w      	r4, (r0, 0)
			DataI = CSP_UART_GET_SR(uart);
  da:	9081      	ld.w      	r4, (r0, 0x4)
			DataI = DataI & UART_TX_FULL;
  dc:	6914      	and      	r4, r5
		}while(DataI == UART_TX_FULL);    //Loop  when tx is full
  de:	3c40      	cmpnei      	r4, 0
  e0:	0bfd      	bt      	0xda	// da <UARTTransmit+0x12>
  e2:	2300      	addi      	r3, 1
  e4:	07f5      	br      	0xce	// ce <UARTTransmit+0x6>

000000e6 <UARTRxByte>:
/*************************************************************/
U16_T UARTRxByte(CSP_UART_T *uart,U8_T *Rxdata_u16)
{
	unsigned int  DataI;

	DataI = CSP_UART_GET_SR(uart);
  e6:	9061      	ld.w      	r3, (r0, 0x4)
	DataI = DataI & UART_RX_FULL;
  e8:	3202      	movi      	r2, 2
  ea:	68c8      	and      	r3, r2
	if(DataI != UART_RX_FULL)    //Loop  when rx is not full
  ec:	3b40      	cmpnei      	r3, 0
  ee:	0c05      	bf      	0xf8	// f8 <UARTRxByte+0x12>
		return FALSE;
	else
	{
		*Rxdata_u16 = CSP_UART_GET_DATA(uart);
  f0:	9060      	ld.w      	r3, (r0, 0)
  f2:	a160      	st.b      	r3, (r1, 0)
	    return TRUE;
  f4:	3001      	movi      	r0, 1
	}
}
  f6:	783c      	rts
		return FALSE;
  f8:	3000      	movi      	r0, 0
  fa:	07fe      	br      	0xf6	// f6 <UARTRxByte+0x10>

000000fc <UART_ReturnRxByte>:
//EntryParameter:UART1
//ReturnValue:(uart)->DATA
/*************************************************************/
U8_T UART_ReturnRxByte(CSP_UART_T *uart)
{
	return CSP_UART_GET_DATA(uart);
  fc:	9000      	ld.w      	r0, (r0, 0)
  fe:	7400      	zextb      	r0, r0
}
 100:	783c      	rts

00000102 <UARTReceive>:
//UART Receive
//EntryParameter:UART1，destAddress_u16，length_u16
//ReturnValue:FALSE/TRUE
/*************************************************************/
U16_T UARTReceive(CSP_UART_T *uart,U8_T *destAddress_u16,U16_T length_u16)
{
 102:	14c4      	push      	r4-r7
	unsigned int  DataI,DataJ,LoopTime;

	DataJ = 0;
	LoopTime = 0;
 104:	3500      	movi      	r5, 0
	DataJ = 0;
 106:	3300      	movi      	r3, 0
	do{
		DataI = CSP_UART_GET_SR(uart);
		DataI = DataI & UART_RX_FULL;
 108:	3602      	movi      	r6, 2
		{
			*destAddress_u16++ = CSP_UART_GET_DATA(uart);
			DataJ++;
			LoopTime = 0;
		}
		if(LoopTime ++ >= 0xfff0)
 10a:	10ef      	lrw      	r7, 0xffef	// 144 <UARTReceive+0x42>
		DataI = CSP_UART_GET_SR(uart);
 10c:	9081      	ld.w      	r4, (r0, 0x4)
		DataI = DataI & UART_RX_FULL;
 10e:	6918      	and      	r4, r6
		if(DataI == UART_RX_FULL)    //Loop  when rx is full
 110:	3c40      	cmpnei      	r4, 0
 112:	0c0d      	bf      	0x12c	// 12c <UARTReceive+0x2a>
			*destAddress_u16++ = CSP_UART_GET_DATA(uart);
 114:	9080      	ld.w      	r4, (r0, 0)
 116:	a180      	st.b      	r4, (r1, 0)
			DataJ++;
 118:	2300      	addi      	r3, 1
			*destAddress_u16++ = CSP_UART_GET_DATA(uart);
 11a:	2100      	addi      	r1, 1
			LoopTime = 0;
 11c:	3400      	movi      	r4, 0
		if(LoopTime ++ >= 0xfff0)
 11e:	651c      	cmphs      	r7, r4
 120:	5ca2      	addi      	r5, r4, 1
 122:	0c07      	bf      	0x130	// 130 <UARTReceive+0x2e>
			return FALSE;
	}while(DataJ < length_u16);
 124:	648c      	cmphs      	r3, r2
 126:	0ff3      	bf      	0x10c	// 10c <UARTReceive+0xa>
	return TRUE;
 128:	3001      	movi      	r0, 1
}
 12a:	1484      	pop      	r4-r7
 12c:	6d17      	mov      	r4, r5
 12e:	07f8      	br      	0x11e	// 11e <UARTReceive+0x1c>
			return FALSE;
 130:	3000      	movi      	r0, 0
 132:	07fc      	br      	0x12a	// 12a <UARTReceive+0x28>
	...
 144:	0000ffef 	.long	0x0000ffef
